#include <time.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>

int main(int argc, char **argv)
{
    struct timeval tmval_arr[2];
    time_t cur_sec;
    int i;

    if(-1 == access(argv[1], F_OK)){
        printf("%s: file doesn't exist!\n", argv[1]);
        exit(-1);
    }

    time(&cur_sec);
    for(i=0; i<2; i++){
        tmval_arr[i].tv_sec = cur_sec;
        tmval_arr[i].tv_usec = 0;
    }

    if(-1 == utimes(argv[1], tmval_arr)){
        perror("utimes error");
        exit(-1);
    }

    exit(0);
}
